package LeetCode;

public class No101 {
    public static void main(String[] args) {
        System.out.println(null==null);
    }
    public boolean isSymmetric(TreeNode root) {
        return getNode(root.left,root.right);
    }

    public boolean getNode(TreeNode leftnode,TreeNode rightnode){
        if(leftnode==rightnode) return true;
        if(leftnode==null&&rightnode!=null||leftnode!=null&&rightnode==null||leftnode.val!=rightnode.val) return false;
        if(leftnode.val==rightnode.val){
            if(getNode(leftnode.left,rightnode.right)){
                return getNode(leftnode.right,rightnode.left);
            }
        }
        return false;
    }
}
